﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.ServiceProcess;
using System.Text;
using System.Data.SqlClient;
using System.Configuration;
using System.Timers;

using CE.Mail;
using System.Collections;
namespace GG_Cash_Installment_Notification_Service
{
    partial class SendCashInstallmentNotification : ServiceBase
    {
        Int64 _carId = 0;
        Int64 _userId = 0;
        EventLog _eventLog = new EventLog();

        private int _emailIntervalSec = Convert.ToInt32(System.Configuration.ConfigurationSettings.AppSettings["EmailIntervalSec"].ToString());
        private int _timerNormalInterval = 11;
        string _serviceTitle = "GG Cash Installment Notification Service";

        public SendCashInstallmentNotification()
        {
            InitializeComponent();
            if (!System.Diagnostics.EventLog.SourceExists("GG_Cash_Installment_Notification_MailService"))
                System.Diagnostics.EventLog.CreateEventSource("GG_Cash_Installment_Notification_MailService",
                                                                      _serviceTitle);
            _eventLog.Source = "GG_Cash_Installment_Notification_MailService";
        }

        protected override void OnStart(string[] args)
        {
            _eventLog.WriteEntry(_serviceTitle + " started " + MyMailManager.GetUTCDateTime().ToString("dd-MMM-yyyy hh:mm tt"), EventLogEntryType.Information);
            timer1.Interval = _timerNormalInterval * 1000;
            timer1.Enabled = true;
        }

        protected override void OnStop()
        {
            timer1.Enabled = false;
            _eventLog.WriteEntry(_serviceTitle + " stopped " + MyMailManager.GetUTCDateTime().ToString("dd-MMM-yyyy hh:mm tt"), EventLogEntryType.Information);
            //_eventLog.WriteEntry("CX - Policy Listing OnStop", EventLogEntryType.Information);
        }

        private void Timer1_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
        {
        //    StartSendingEmail();
        //}

        //public void StartService()
        //{
        //    StartSendingEmail();
        //    //timer1.Enabled = false;
        //}
        //private void StartSendingEmail()
        //{

            //timer1.Enabled = false;
            int NoOfDays = Convert.ToInt32(System.Configuration.ConfigurationManager.AppSettings["NoOfDays"].ToString());
            timer1.Interval = (24 * NoOfDays) * 60 * 60 * 1000;


            string _conString = "";
            SqlCommand _sqlCmd = null;
            SqlConnection _sqlConn = new SqlConnection();

            string _emailTitle = string.Empty;
            string[] fileList = new string[0];
            string _toemail = "";
            string _ccemail = "";
            string _bccemail = "";
            StringBuilder _emailBody;
            System.Text.StringBuilder _strEmailList = new StringBuilder();
            string _step = "Step 1";
            int _mailOneSendCount = 0;
            try
            {
                _eventLog.WriteEntry(_step + " " + MyMailManager.GetUTCDateTime().ToString("dd-MMM-yyyy hh:mm tt"), EventLogEntryType.Information);
                string IsLive = System.Configuration.ConfigurationManager.AppSettings["IsOnLive"].ToString();
                string IsSendEmailCustomer = System.Configuration.ConfigurationManager.AppSettings["IsSendEmailCustomer"].ToString();
                //NoOfDays = 1 = today
                _toemail = System.Configuration.ConfigurationSettings.AppSettings["ToEmail"].ToString();
                _ccemail = System.Configuration.ConfigurationSettings.AppSettings["CcEmail"].ToString();
                _bccemail = System.Configuration.ConfigurationSettings.AppSettings["BccEmail"].ToString();

                string _smtpAccount = System.Configuration.ConfigurationManager.AppSettings["SMTPAccount"].ToString();
                string _smtpAuthCode = System.Configuration.ConfigurationManager.AppSettings["SMTPAuthCode"].ToString();
                string _smtpInternalAccount = System.Configuration.ConfigurationManager.AppSettings["InternalSMTPAccount"].ToString();
                string _smtpInternalAuthCode = System.Configuration.ConfigurationManager.AppSettings["InternalSMTPAuthCode"].ToString();
                string _smtpReplyTo = System.Configuration.ConfigurationManager.AppSettings["SMTPReplyTo"].ToString();

                _step = "Step 2";
                _eventLog.WriteEntry(_step + " " + MyMailManager.GetUTCDateTime().ToString("dd-MMM-yyyy hh:mm tt"), EventLogEntryType.Information);
                _conString = ConfigurationManager.ConnectionStrings["CX_DBConnectionString"].ToString();

                _sqlConn.ConnectionString = _conString;
                DataSet _dsResult = new DataSet();
                _sqlCmd = new SqlCommand();
                _sqlCmd.Connection = _sqlConn;
                _sqlCmd.CommandType = CommandType.StoredProcedure;
                _sqlCmd.CommandText = "sprocCashInstallmentNotificationList";

                SqlDataAdapter _sqlDa = new SqlDataAdapter(_sqlCmd);

                _sqlDa.Fill(_dsResult);
                _step = _dsResult.Tables[0].Rows.Count.ToString();
                _step = "Step 3";
                _eventLog.WriteEntry(_step + " " + MyMailManager.GetUTCDateTime().ToString("dd-MMM-yyyy hh:mm tt"), EventLogEntryType.Information);

                try
                {
                    //9/12/2556 save to tblWindowServiceLog
                    _sqlCmd = new SqlCommand();
                    _sqlCmd.Connection = _sqlConn;
                    _sqlCmd.CommandType = CommandType.StoredProcedure;
                    _sqlCmd.CommandText = "[sprocWindowServiceSaveLog]";
                    _sqlCmd.Parameters.AddWithValue("@ServiceName", "GG_Cash_Installment_Notification_Service");
                    _sqlCmd.Parameters.AddWithValue("@Subject", _serviceTitle + " was started at " + MyMailManager.GetUTCDateTime().ToString("dd/MM/yyyy hh:mm:ss"));
                    _sqlCmd.Parameters.AddWithValue("@EmailCount", _dsResult.Tables[0].Rows.Count);
                    _sqlCmd.Parameters.AddWithValue("@ServiceStatus", 1);
                    _sqlCmd.Parameters.AddWithValue("@Status", 1);
                    _sqlConn.Open();
                    _sqlCmd.ExecuteNonQuery();
                    _sqlConn.Close();
                }
                catch (Exception ex)
                {
                    string xx = ex.Message.ToString();
                }

                #region MailBody
                if (_dsResult != null && _dsResult.Tables.Count > 0 && _dsResult.Tables[0].Rows.Count > 0)
                {
                    _step = "Step 4";
                    int _mailThreeSendCount = 0;
                    int _noQuotationResultCount = 0;
                    StringBuilder strNoQuotationCarList = new StringBuilder();
                    strNoQuotationCarList.Append("<table width=\"300px\" border=\"1\" cellspacing=\"5\" cellpadding=\"5\"><tr><th><b>Car ID</b></th><th><b>Customer ID</b></th></tr>");

                    //if (_dsResult.Tables[0].Rows.Count > 0)
                    //{
                    _eventLog.WriteEntry(_serviceTitle + " Started at [" + MyMailManager.GetUTCDateTime().ToString("dd/MMM/yyyy hh:mm:ss") + "].", EventLogEntryType.Information);
                    //}
                    //else
                    //{
                    //    _eventLog.WriteEntry(_serviceTitle + " No Mail to send. [" + MyMailManager.GetUTCDateTime().ToString() + "].", EventLogEntryType.Information);
                    //}

                    _emailBody = new StringBuilder();
                    //_emailTitle = "<Started> " + _serviceTitle + " - " + MyMailManager.GetUTCDateTime().ToString("dd-MMM-yyyy hh:mm tt");
                    _emailTitle = _serviceTitle + " - " + MyMailManager.GetUTCDateTime().ToString("dd-MMM-yyyy hh:mm tt");
                    _emailBody.Append("Dear All,<br/><br/>");
                    _emailBody.Append(_serviceTitle + " was started at " + MyMailManager.GetUTCDateTime().ToString("dd/MMM/yyyy hh:mm:ss") + "<br/><br/>");

                    //_emailBody.Append("No. of days to batch : <b>" + NoOfDays.ToString() + "</b> days.<br/><br/>");

                    //if (_dsResult.Tables[0].Rows.Count > 0)
                    //{
                    _emailBody.Append("No. of Cash Installment Notification mail : <b>" + _dsResult.Tables[0].Rows.Count + "</b><br/><br/>");

                    //_emailBody.Append("<b>Please check following customer list details as your reference.</b><br/><br/>");


                    _emailBody.Append("<table border='1'>");
                    _emailBody.Append("<caption style='color:blue'><b>Cash Installment Notification mail</b></caption>");
                    _emailBody.Append("<tr bgcolor='lightgray'><th>No.</th><th>CarID</th><th>เลขที่สัญญา</th><th>ชื่อ</th><th>Email</th><th>Phone</th><th>วันที่ต้องชำระ</th></tr>");
                    for (int i = 0; i < _dsResult.Tables[0].Rows.Count; i++)
                    {
                        _emailBody.Append("<tr " + ((i % 2 == 0) ? "bgcolor='#ffffcc'" : "") + "><td>" + (i + 1).ToString() + "</td><td>" + _dsResult.Tables[0].Rows[i]["CECarId"].ToString() + "</td><td>" + _dsResult.Tables[0].Rows[i]["QuoteRefNo"].ToString() + "</td><td>" + _dsResult.Tables[0].Rows[i]["CustomerName"] + "</td><td>" + _dsResult.Tables[0].Rows[i]["Email"] + "</td><td>" + _dsResult.Tables[0].Rows[i]["Phone"] + "</td><td>" + Convert.ToDateTime(_dsResult.Tables[0].Rows[i]["InstallmentDate"]).ToString("dd-MMM-yyyy") + "</td></tr>");
                    }
                    _emailBody.Append("</table>");
                    _emailBody.Append("<br/><br/>");

                    //}
                    //else
                    //{
                    //    _emailBody.Append("<b>No mail to send.</b>");
                    //}

                    while (!MyMailManager.SendGGMail(_smtpInternalAccount, _smtpInternalAuthCode, _toemail, _ccemail, _bccemail, _emailTitle, _emailBody.ToString(), _smtpReplyTo))
                    {
                        _eventLog.WriteEntry(_serviceTitle + " - Failed to send STARTED MAIL to GG-Team at [" + MyMailManager.GetUTCDateTime().ToString() + "].", EventLogEntryType.Error);
                        System.Threading.Thread.Sleep(_emailIntervalSec * 3000);
                    }
                    _mailOneSendCount += 1;

                    if (IsSendEmailCustomer == "1")
                    {
                        //CC and BCC with customer mail
                        string _ccwithcus = System.Configuration.ConfigurationSettings.AppSettings["CcWithCustomerEmail"].ToString();
                        string _bccwithcus = "";
                        if (System.Configuration.ConfigurationSettings.AppSettings["IsCustomerEmailCheck"].ToString() == "1")
                            _bccwithcus = System.Configuration.ConfigurationSettings.AppSettings["BccWithCustomerEmail"].ToString();


                        foreach (DataRow drResrult1 in _dsResult.Tables[0].Rows)
                        {
                            string _toCusEmail = "";
                            if (IsLive == "1")
                            {
                                _toCusEmail = drResrult1["Email"].ToString();
                            }
                            if (_toCusEmail.Trim() != "")
                            {

                                StringBuilder _emailCusBody = new StringBuilder();


                                double installmentPrice = 0.0;
                                int installmentTimes = Convert.ToInt32(drResrult1["NoofInstallment"]);
                                if (installmentTimes == 2)
                                {
                                    installmentPrice = Math.Ceiling((Convert.ToDouble(drResrult1["ApprovedPremium"]) / 10) * 5);
                                }
                                else if (installmentTimes == 3)
                                {
                                    installmentPrice = Math.Ceiling((Convert.ToDouble(drResrult1["ApprovedPremium"]) / 10) * 3);
                                }
                                else if (installmentTimes == 4)
                                {
                                    installmentPrice = Math.Ceiling(Convert.ToDouble(drResrult1["ApprovedPremium"]) / 4);
                                }

                                StringBuilder _emailTableRow = new StringBuilder();



                                string _emailCusTitle = "แจ้งเตือนชำระสินเชื่อค่าเบี้ยประกันภัย";

                                #region Old Design - Not using
                                ///////////////////body////////////////
                                //_emailCusBody.Append("<table border=\"0px\" cellpadding=\"0\" width:630px; cellspacing=\"0\" style=\"font-family:Tahoma,Arial,Helvetica,sans-serif; font-size:16px; padding-left:40px;\"><tr>");
                                //_emailCusBody.Append("<td colspan=\"5\" style=\"color:#5C5CFF;\">");
                                //_emailCusBody.Append("<b>รายละเอียดการแจ้งเตือนชำระสินเชื่อค่าเบี้ยประกันภัย</b><br /><br /></td><tr>");
                                //_emailCusBody.Append("<tr>");
                                //_emailCusBody.Append("<td>ชื่อลูกค้า</td><td style=\"text-decoration:underline;\">คุณ" + drResrult1["CustomerName"].ToString() + "</td>");
                                //_emailCusBody.Append("<td  colspan=\"2\" style=\"text-align:right;\">วันที่</td><td style=\"width:170px; text-decoration:underline;\">" + MyMailManager.GetUTCDateTime().ToString("dd-MMM-yyyy") + "</td>");
                                //_emailCusBody.Append("</tr><tr>");
                                //_emailCusBody.Append("<td>เลขที่บัตรประชาชน</td><td style=\"text-decoration:underline;\"></td>");
                                //_emailCusBody.Append("<td colspan=\"2\" style=\"text-align:right;\">เลขที่สัญญา</td><td style=\"text-decoration:underline;\">" + drResrult1["QuoteRefNo"].ToString() + "</td>");
                                //_emailCusBody.Append("</tr><tr>");
                                //_emailCusBody.Append("<td>ทะเบียนรถยนต์</td><td style=\"text-decoration:underline;\">" + drResrult1["CarPlate"].ToString() + "</td><td></td>");
                                //_emailCusBody.Append("<td></td><td></td>");
                                //_emailCusBody.Append("</tr><tr>");
                                //_emailCusBody.Append("<td>บริษัทประกัน</td><td style=\"text-decoration:underline;\">" + drResrult1["CompanyName"].ToString() + "</td><td></td>");
                                //_emailCusBody.Append("<td></td><td></td>");
                                //_emailCusBody.Append("</tr><tr>");
                                //_emailCusBody.Append("<td colspan=\"5\">&nbsp;&nbsp;</td>");
                                //_emailCusBody.Append("</tr><tr>");
                                //_emailCusBody.Append("<td>ยอดเงินที่ต้องชำระงวดที่</td><td style=\"text-align:right;\">" + drResrult1["Installment"].ToString() + "</td><td>ยอด</td>");
                                //_emailCusBody.Append("<td style=\"text-align:right;\">" + installmentPrice.ToString("#,##0.00") + "</td><td>บาท</td>");
                                //_emailCusBody.Append("</tr><tr>");
                                //_emailCusBody.Append("<td colspan=\"3\">จำนวนเงินในการขอสินเชื่อค่าเบี้ยประกันภัย</td>");
                                //_emailCusBody.Append("<td></td><td></td>");
                                //_emailCusBody.Append("</tr><tr>");
                                //_emailCusBody.Append("<td>เบี้ยประกันภัยที่ขอสินเชื่อ</td><td style=\"text-align:right;\">" + Convert.ToDouble(drResrult1["ApprovedPremium"]).ToString("#,##0.00") + "</td><td>บาท</td>");
                                //_emailCusBody.Append("<td></td><td></td>");
                                //_emailCusBody.Append("</tr><tr>");
                                //_emailCusBody.Append("<td>เบี้ยประกันภัยรวมภาษีอากร</td><td style=\"text-align:right;\">" + Convert.ToDouble(drResrult1["ApprovedPremium"]).ToString("#,##0.00") + "</td><td>บาท</td>");
                                //_emailCusBody.Append("<td></td><td></td>");
                                //_emailCusBody.Append("</tr><tr>");
                                //_emailCusBody.Append("<td>ขอผ่อนชำระเป็นงวดทั้งหมด</td><td style=\"text-align:right;\">" + drResrult1["NoofInstallment"].ToString() + "</td><td>งวด</td>");
                                //_emailCusBody.Append("<td></td><td></td>");
                                //_emailCusBody.Append("</tr><tr>");
                                //_emailCusBody.Append("<td>วิธีการชำระเงิน</td><td>เงินสด</td><td></td>");
                                //_emailCusBody.Append("<td></td><td></td>");
                                //_emailCusBody.Append("</tr><tr>");
                                //_emailCusBody.Append("<td>วันที่ครบกำหนดชำระ</td><td>" + Convert.ToDateTime(drResrult1["InstallmentDate"]).ToString("dd-MMM-yyyy") + "</td><td></td>");
                                //_emailCusBody.Append("<td></td><td></td>");
                                //_emailCusBody.Append("</tr><tr>");



                                //_emailCusBody.Append("</table><br/>");

                                ///////////////////fixedText////////////////
                                //_emailCusBody.Append("<table border=\"0px\" cellpadding=\"0\" width:630px; cellspacing=\"0\" style=\"font-family:Tahoma,Arial,Helvetica,sans-serif; font-size:16px; padding-left:40px;\">");
                                //_emailCusBody.Append("<tr><td colspan=\"3\">ชำระเงินโดย : โอนเงินเข้าบัญชี</td></tr>");
                                //_emailCusBody.Append("<tr><td colspan=\"3\">ชื่อบัญชี  <span  style=\"text-decoration:underline;\">&quot;บริษัท คอมแพร์เอ็กซ์เพรส นายหน้าประกันภัย (ประเทศไทย) จำกัด&quot;</span></td></tr>");
                                //_emailCusBody.Append("<tr><td>1. ธนาคารกรุงเทพ สาขาสำนักงานใหญ่สีลม</td><td>บัญชีสะสมทรัพย์</td><td>เลขที่บัญชี  101-857590-0</td></tr>");
                                //_emailCusBody.Append("<tr><td>2. ธนาคารกสิกรไทย สาขาสำนักสีลม</td><td>บัญชีออมทรัพย์</td><td>เลขที่บัญชี  789-2-25470-7</td></tr>");
                                //_emailCusBody.Append("<tr><td>3. ธนาคารไทยพาณิชย์ สาขา ปาโซ่ ทาวเวอร์</td><td>บัญชีออมทรัพย์</td><td>เลขที่บัญชี  245-206286-2</td></tr>");
                                //_emailCusBody.Append("<tr><td>4. ธนาคารกรุงไทย สาขา สีลม</td><td>บัญชีออมทรัพย์</td><td>เลขที่บัญชี  022-0-15766-9</td></tr>");
                                //_emailCusBody.Append("<tr><td colspan=\"3\">&nbsp;</td></tr>");
                                //_emailCusBody.Append("<tr><td colspan=\"3\">หากมีการชำระเรียบร้อยแล้วกรุณาส่งหลักฐานการชำระเงินมาที่</td></tr>");
                                //_emailCusBody.Append("<tr><td colspan=\"3\">บริษัท คอมแพร์เอ็กซ์เพรส นายหน้าประกันภัย (ประเทศไทย) จำกัด</td></tr>");
                                //_emailCusBody.Append("<tr><td colspan=\"3\">ชั้น 42 อาคารยูไนเต็ด เซ็นเตอร์</td></tr>");
                                //_emailCusBody.Append("<tr><td colspan=\"3\">เลขที่ 323 ถนนสีลม แขวงสีลม เขตบางรัก กรุงเทพฯ 10500</td></tr>");
                                //_emailCusBody.Append("<tr><td colspan=\"3\">โทร 02-268-8222 โทรสาร 02-266-6339</td></tr>");
                                //_emailCusBody.Append("<tr><td colspan=\"3\">อีเมล์: support@gluaygluay.com	</td></tr>");
                                //_emailCusBody.Append("<tr><td colspan=\"3\">&nbsp;</td></tr>");
                                //_emailCusBody.Append("<tr><td colspan=\"3\"><span style=\"color:Red;\">หมายเหตุ </span>:</td></tr>");
                                //_emailCusBody.Append("<tr><td colspan=\"3\" style=\"color:Red;\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1.&nbsp;กรณีชำระล่าช้ากว่า 2 วัน ลูกค้าต้องชำระค่าปรับเป็นจำนวน 200 บาท</td></tr>");
                                //_emailCusBody.Append("<tr><td colspan=\"3\" style=\"color:Red;\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;และกรณีชำระช้ากว่า 5 วัน ลูกค้าจะถูกริบเงินค่าผ่อนงวดแรกทั้งหมด</td></tr>");
                                //_emailCusBody.Append("<tr><td colspan=\"3\" style=\"color:Red;\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;แต่กรณีลูกค้าร้องขอให้ต่อกรมธรรม์ให้ ลูกค้าจะถูกปรับ 500 บาท </td></tr>");
                                //_emailCusBody.Append("<tr><td colspan=\"3\" style=\"color:Red;\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ทั้งนี้ขึ้นอยู่กับการพิจารณาของบริษัทว่าจะต่อให้หรือว่ายกเลิก </td></tr>");
                                //_emailCusBody.Append("<tr><td colspan=\"3\" style=\"color:Red;\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2.&nbsp;ลูกค้าจะได้รับกรมธรรม์ฉบับจริงต่อเมื่อมีการชำระค่าเบี้ยประกันภัยครบถ้วนแล้วเท่านั้น </td></tr><br />");
                                //_emailCusBody.Append("<tr><td colspan=\"3\">อีเมลนี้ส่งจากระบบ ขออภัยหากมีการชำระเงินแล้ว</td></tr><br /><br />");
                                //_emailCusBody.Append("<tr><td colspan=\"3\">ขอแสดงความนับถือ</td></tr>");
                                //_emailCusBody.Append("<tr><td colspan=\"3\">Admin กล้วยกล้วย</td></tr>");
                                //_emailCusBody.Append("<tr><td colspan=\"3\"><a  style=\"text-decoration:none\" href=\"http://www.gluaygluay.com\"><img src=\"http://www.gluaygluay.com/maintenance-test/gluaygluay-logo_01.jpg\"/></a></td></tr>");
                                //_emailCusBody.Append("<tr><td colspan=\"3\"><b>Comparexpress Insurance Broker (Thailand) Ltd.</b></td></tr>");
                                //_emailCusBody.Append("<tr><td colspan=\"3\">ชั้น 42 อาคารยูไนเต็ด เซ็นเตอร์</td></tr>");
                                //_emailCusBody.Append("<tr><td colspan=\"3\">เลขที่ 323 ถนนสีลม แขวงสีลม เขตบางรัก กรุงเทพฯ 10500</td></tr>");
                                //_emailCusBody.Append("<tr><td colspan=\"3\">TEL&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: +66 2 268 8222</td></tr>");
                                //_emailCusBody.Append("<tr><td colspan=\"3\">EMAIL&nbsp;&nbsp;: admin@comparexpress.co.th</td></tr>");
                                //_emailCusBody.Append("<tr><td colspan=\"3\">WEB&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: www.GluayGluay.com</td></tr>");
                                //_emailCusBody.Append("<tr><td colspan=\"3\">FAX&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: +66 2 266 6339</td></tr>");


                                //_emailCusBody.Append("</td></tr>");
                                //_emailCusBody.Append("</table>");
                                #endregion

                                #region New design
                                string _mailBody = "";
                                string domainUrl = "http://www.gluaygluay.com";


                                #region Header
                                _mailBody = "<html>";
                                _mailBody += "<head>";
                                _mailBody += "<meta http-equiv='Content-Type' content='text/html; charset=UTF-8' />";
                                _mailBody += "<title>GluayGluay</title>";
                                _mailBody += "<style>";

                                _mailBody += ".body {";
                                _mailBody += "margin-left: 0px;";
                                _mailBody += "margin-top: 0px;";
                                _mailBody += "margin-right: 0px;";
                                _mailBody += "margin-bottom: 0px;";
                                _mailBody += "font-family: Arial, sans-serif;";
                                _mailBody += "font-size: 14px;";
                                _mailBody += "color: #000000;";
                                _mailBody += "background-repeat: repeat-x;";
                                _mailBody += "background-color: #fff;";
                                _mailBody += "text-decoration: none;}";

                                _mailBody += "hr{";
                                _mailBody += "display: block;";
                                _mailBody += "height: 1px;";
                                _mailBody += "border: 0;";
                                _mailBody += "border-top: 1px solid #ccc;";
                                _mailBody += "margin: 1em 0;";
                                _mailBody += "padding: 0;}";

                                _mailBody += ".line-height{line-height: 20px;}";
                                _mailBody += ".table-txt{padding-left: 5px;}";

                                _mailBody += "</style>";
                                _mailBody += "</head>";
                                #endregion

                                #region Body
                                _mailBody += "<body>";
                                _mailBody += "<div>";
                                _mailBody += "<table width='800' border='0' align='center' cellpadding='0' cellspacing='0'>";
                                _mailBody += "<tr>";
                                _mailBody += "<td height='653' align='right' valign='bottom' bgcolor='#FFFFFF'>";

                                _mailBody += "<table width='800' height='100' border='0' cellspacing='0' cellpadding='0'>";
                                _mailBody += "<tr>";
                                _mailBody += "<td>";
                                _mailBody += "<span><img src='" + domainUrl + "/images/email-header.jpg' width='800' height='100' alt='' /></span>";
                                _mailBody += "</td>";
                                _mailBody += "</tr>";
                                _mailBody += "</table>";

                                _mailBody += "<table width='800' border='0' align='center' cellpadding='0' cellspacing='0'>";
                                _mailBody += "<tr>";
                                _mailBody += "<td width='530' height='419' valign='top' bgcolor='#FFFFFF'>";
                                _mailBody += "<p>";
                                _mailBody += "<strong style='font-style: normal; font-weight: normal; font-size: 18px;'>รายละเอียดการแจ้งเตือนชำระสินเชื่อค่าเบี้ยประกันภัย</strong><br />";
                                _mailBody += "</p>";

                                #region Inner Content
                                _mailBody += "<table width='800' border='0' cellspacing='0' cellpadding='0'>";
                                _mailBody += "<tr>";
                                _mailBody += "<td height='210' valign='top' style='font-style: normal; font-size: 14px;'>";
                                _mailBody += "<table width='800' border='0' cellspacing='1' cellpadding='1'>";
                                _mailBody += "<tr>";
                                _mailBody += "<td width='240' height='25' bgcolor='#E7E7E7'>";
                                _mailBody += "ชื่อลูกค้า";
                                _mailBody += "</td>";
                                _mailBody += "<td width='220' bgcolor='#E7E7E7'>";
                                _mailBody += drResrult1["CustomerName"].ToString();
                                _mailBody += "</td>";
                                _mailBody += "<td width='140' bgcolor='#E7E7E7'>";
                                _mailBody += "วันที่";
                                _mailBody += "</td>";
                                _mailBody += "<td width='200' bgcolor='#E7E7E7'>";
                                _mailBody += MyMailManager.GetUTCDateTime().ToString("dd-MMM-yyyy");
                                _mailBody += "</td>";
                                _mailBody += "</tr>";
                                _mailBody += "<tr>";
                                _mailBody += "<td height='25' bgcolor='#FFFFFF'>";
                                _mailBody += "<span class='table-txt'>เลขที่บัตรประชาชน</span>";
                                _mailBody += "</td>";
                                _mailBody += "<td height='25' bgcolor='#FFFFFF'>";
                                _mailBody += "<span class='table-txt'>";
                                _mailBody += "&nbsp;";//_mailBody += installmentPrice.ToString("#,##0.00") + " บาท";
                                _mailBody += "</span>";
                                _mailBody += "</td>";
                                _mailBody += "<td bgcolor='#FFFFFF'>";
                                _mailBody += "เลขที่สัญญา";
                                _mailBody += "</td>";
                                _mailBody += "<td bgcolor='#FFFFFF'>";
                                _mailBody += drResrult1["QuoteRefNo"].ToString();
                                _mailBody += "</td>";
                                _mailBody += "</tr>";
                                _mailBody += "<tr>";
                                _mailBody += "<td height='25' bgcolor='#E7E7E7'>";
                                _mailBody += "ทะเบียนรถยนต์";
                                _mailBody += "</td>";
                                _mailBody += "<td height='25' bgcolor='#E7E7E7'>";
                                _mailBody += drResrult1["CarPlate"].ToString();
                                _mailBody += "</td>";
                                _mailBody += "<td bgcolor='#E7E7E7'>";
                                _mailBody += "บริษัทประกัน";
                                _mailBody += "</td>";
                                _mailBody += "<td bgcolor='#E7E7E7'>";
                                _mailBody += drResrult1["CompanyName"].ToString();
                                _mailBody += "</td>";
                                _mailBody += "</tr>";
                                _mailBody += "</table>";
                                _mailBody += "<br />";

                                _mailBody += "<table width='800' border='0' cellspacing='1' cellpadding='1'>";
                                _mailBody += "<tr>";
                                _mailBody += "<td width='240' height='25'>";
                                _mailBody += "ยอดเงินที่ต้องชำระงวดที่";
                                _mailBody += "</td>";
                                _mailBody += "<td>";
                                _mailBody += drResrult1["Installment"].ToString();
                                _mailBody += " ยอด ";
                                _mailBody += installmentPrice.ToString("#,##0.00") + " บาท ";
                                _mailBody += "</td>";
                                _mailBody += "</tr>";
                                _mailBody += "<tr>";
                                _mailBody += "<td height='25' colspan='2'>";
                                _mailBody += "จำนวนเงินในการขอสินเชื่อค่าเบี้ยประกันภัย";
                                _mailBody += "</td>";
                                _mailBody += "</tr>";
                                _mailBody += "<tr>";
                                _mailBody += "<td width='240' height='25'>";
                                _mailBody += "เบี้ยประกันภัยที่ขอสินเชื่อ";
                                _mailBody += "</td>";
                                _mailBody += "<td>";
                                _mailBody += Convert.ToDouble(drResrult1["ApprovedPremium"]).ToString("#,##0.00") + " บาท ";
                                _mailBody += "</td>";
                                _mailBody += "</tr>";
                                _mailBody += "<tr>";
                                _mailBody += "<td width='240' height='25' class='table-txt'>";
                                _mailBody += "เบี้ยประกันภัยรวมภาษีอากร";
                                _mailBody += "</td>";
                                _mailBody += "<td class='table-txt'>";
                                _mailBody += Convert.ToDouble(drResrult1["ApprovedPremium"]).ToString("#,##0.00") + " บาท ";
                                _mailBody += "</td>";
                                _mailBody += "</tr>";
                                _mailBody += "<tr>";
                                _mailBody += "<td width='240' height='25'>";
                                _mailBody += "ขอผ่อนชำระเป็นงวดทั้งหมด";
                                _mailBody += "</td>";
                                _mailBody += "<td>";
                                _mailBody += drResrult1["NoofInstallment"].ToString() + " งวด";
                                _mailBody += "</td>";
                                _mailBody += "</tr>";
                                _mailBody += "<tr>";
                                _mailBody += "<td width='240' height='25'>";
                                _mailBody += "วิธีการชำระเงิน";
                                _mailBody += "</td>";
                                _mailBody += "<td>";
                                _mailBody += "เงินสด";
                                _mailBody += "</td>";
                                _mailBody += "</tr>";
                                _mailBody += "<tr>";
                                _mailBody += "<td width='240' height='25'>";
                                _mailBody += "วันที่ครบกำหนดชำระ";
                                _mailBody += "</td>";
                                _mailBody += "<td>";
                                _mailBody += Convert.ToDateTime(drResrult1["InstallmentDate"]).ToString("dd-MMM-yyyy");
                                _mailBody += "</td>";
                                _mailBody += "</tr>";
                                _mailBody += "</table>";
                                _mailBody += "<br />";
                                _mailBody += "<table width='800' border='0' cellpadding='0' cellspacing='0'>";
                                _mailBody += "<tr>";
                                _mailBody += "<td width='580' valign='top' style='font-style: normal; font-size: 18px;'>";
                                _mailBody += "<span class='line-height'>ชำระเงินโดย : โอนเงินเข้าบัญชี<br />";
                                _mailBody += "<span style='font-size: 14px'>ชื่อบัญชี &quot;บริษัท คอมแพร์เอ็กซ์เพรส นายหน้าประกันภัย (ประเทศไทย) จำกัด&quot;</span></span><br />";
                                _mailBody += "</td>";
                                _mailBody += "<td width='220' rowspan='9' valign='top' style='font-style: normal; font-size: 18px;'>";
                                _mailBody += "<img src='" + domainUrl + "/images/cash-chac.jpg' width='220' height='300' alt='' />";
                                _mailBody += "</td>";
                                _mailBody += "</tr>";
                                _mailBody += "<tr>";
                                _mailBody += "<td valign='top' style='font-style: normal; font-size: 18px;'>";
                                _mailBody += "<br />";
                                _mailBody += "<span style='font-size: 14px'>";
                                _mailBody += "1. ธนาคารกรุงเทพ สาขาสำนักงานใหญ่สีลม บัญชีสะสมทรัพย์  เลขที่บัญชี 101-857590-0<br />";
                                _mailBody += "2. ธนาคารกสิกรไทย สาขาสำนักสีลม บัญชีออมทรัพย์ เลขที่บัญชี 789-2-25470-7<br />";
                                _mailBody += "3. ธนาคารไทยพาณิชย์ สาขา ปาโซ่ ทาวเวอร์ บัญชีออมทรัพย์ เลขที่บัญชี 245-206286-2<br />";
                                _mailBody += "4. ธนาคารกรุงไทย สาขา สีลม บัญชีออมทรัพย์ เลขที่บัญชี 022-0-15766-9";
                                _mailBody += "</span>";
                                _mailBody += "</td>";
                                _mailBody += "</tr>";
                                _mailBody += "<tr>";
                                _mailBody += "<td valign='top' style='font-style: normal; font-size: 18px;'>";
                                _mailBody += "&nbsp;";
                                _mailBody += "</td>";
                                _mailBody += "</tr>";
                                _mailBody += "<tr>";
                                _mailBody += "<td valign='top' style='font-style: normal; font-size: 14px;'>";
                                _mailBody += "หากมีการชำระเรียบร้อยแล้วกรุณาส่งหลักฐานการชำระเงินมาที่<br />";
                                _mailBody += "บริษัท คอมแพร์เอ็กซ์เพรส นายหน้าประกันภัย (ประเทศไทย) จำกัด<br />";
                                _mailBody += "ชั้น 42 อาคารยูไนเต็ด เซ็นเตอร์<br />";
                                _mailBody += "เลขที่ 323 ถนนสีลม แขวงสีลม เขตบางรัก กรุงเทพฯ 10500<br />";
                                _mailBody += "โทร 02-268-8222 โทรสาร 02-266-6339<br />";
                                _mailBody += "อีเมล์: support@gluaygluay.com";
                                _mailBody += "</td>";
                                _mailBody += "</tr>";
                                _mailBody += "<tr>";
                                _mailBody += "<td valign='top' style='font-style: normal; font-size: 14px;'>";
                                _mailBody += "&nbsp;";
                                _mailBody += "</td>";
                                _mailBody += "</tr>";
                                _mailBody += "<tr>";
                                _mailBody += "<td valign='top' style='font-style: normal; font-size: 18px;'>";
                                _mailBody += "หมายเหตุ";
                                _mailBody += "</td>";
                                _mailBody += "</tr>";
                                _mailBody += "<tr>";
                                _mailBody += "<td valign='top' style='font-style: normal; font-size: 14px;'>";
                                _mailBody += "1. กรณีชำระล่าช้ากว่า 2 วัน ลูกค้าต้องชำระค่าปรับเป็นจำนวน 200 บาท<br />";
                                _mailBody += "และกรณีชำระช้ากว่า 5 วัน ลูกค้าจะถูกริบเงินค่าผ่อนงวดแรกทั้งหมด<br />";
                                _mailBody += "แต่กรณีลูกค้าร้องขอให้ต่อกรมธรรม์ให้ ลูกค้าจะถูกปรับ 500 บาท<br />";
                                _mailBody += "ทั้งนี้ขึ้นอยู่กับการพิจารณาของบริษัทว่าจะต่อให้หรือว่ายกเลิก<br />";
                                _mailBody += "<br />";
                                _mailBody += "2. ลูกค้าจะได้รับกรมธรรม์ฉบับจริงต่อเมื่อมีการชำระค่าเบี้ยประกันภัยครบถ้วนแล้วเท่านั้น";
                                _mailBody += "</td>";
                                _mailBody += "</tr>";
                                _mailBody += "<tr>";
                                _mailBody += "<td valign='top' style='font-style: normal; font-size: 14px;'>";
                                _mailBody += "<br />";
                                _mailBody += "อีเมลนี้ส่งจากระบบ ขออภัยหากมีการชำระเงินแล้ว";
                                _mailBody += "</td>";
                                _mailBody += "</tr>";
                                _mailBody += "<tr>";
                                _mailBody += "<td valign='top' style='font-style: normal; font-size: 14px;'>";
                                _mailBody += "<table border='0px' cellpadding='0' cellspacing='0'>";
                                _mailBody += "<tbody>";
                                _mailBody += "<tr>";
                                _mailBody += "<td colspan='3'>";
                                _mailBody += "<br />";
                                _mailBody += "ขอแสดงความนับถือ";
                                _mailBody += "</td>";
                                _mailBody += "</tr>";
                                _mailBody += "<tr>";
                                _mailBody += "<td colspan='3'>";
                                _mailBody += "Admin กล้วยกล้วย";
                                _mailBody += "</td>";
                                _mailBody += "</tr>";
                                _mailBody += "</tbody>";
                                _mailBody += "</table>";
                                _mailBody += "</td>";
                                _mailBody += "</tr>";
                                _mailBody += "</table>";
                                _mailBody += "<br />";
                                _mailBody += "</td>";
                                _mailBody += "</tr>";
                                _mailBody += "</table>";
                                #endregion

                                _mailBody += "<hr />";
                                _mailBody += "<p>";
                                _mailBody += "<b>ฝ่ายประสานงาน GluayGluay</b><br />";
                                _mailBody += "บริษัทคอมแพร์เอ็กซ์เพรส นายหน้าประกันภัย(ประเทศไทย) จำกัด<br />";
                                _mailBody += "ใบอนุญาติ คปภ.: ว00016/2553<br />";
                                _mailBody += "ชั้น 42 อาคารยูไนเต็ด เซ็นเตอร์<br />";
                                _mailBody += "เลขที่ 323 ถนนสีลม แขวงสีลม<br />";
                                _mailBody += "เขตบางรัก กรุงเทพฯ 10500";
                                _mailBody += "</p>";
                                _mailBody += "<p>";
                                _mailBody += "โทร : 02-268-8222<br />";
                                _mailBody += "แฟกซ์ : 02-266-6339<br />";
                                _mailBody += "<a href='mailto:support@gluaygluay.com'>support@gluaygluay.com</a>";
                                _mailBody += "</p>";
                                _mailBody += "</td>";
                                _mailBody += "</tr>";
                                _mailBody += "</table>";

                                #region Footer
                                _mailBody += "<hr />";
                                _mailBody += "<table width='300' border='0' align='center' cellpadding='0' cellspacing='0'>";
                                _mailBody += "<tr>";
                                _mailBody += "<td width='44' style='text-align: center'>";
                                _mailBody += "<a href='https://www.facebook.com/GGmotor' target='_blank'><img src='" + domainUrl + "/images/icons/fb-big.png' width='44' height='42'></a>";
                                _mailBody += "</td>";
                                _mailBody += "<td width='44' style='text-align: center'>";
                                _mailBody += "<a href='https://plus.google.com/+Gluaygluay/posts' target='_blank'><img src='" + domainUrl + "/images/icons/g-plus-big.png' width='44' height='42'></a>";
                                _mailBody += "</td>";
                                _mailBody += "<td width='44' style='text-align: center'>";
                                _mailBody += "<a href='http://www.youtube.com/channel/UCZ4gMtlXymBHxvcXO2cR1vA' target='_blank'><img src='" + domainUrl + "/images/icons/youtube-big.png' width='44' height='42'></a>";
                                _mailBody += "</td>";
                                _mailBody += "<td width='44' style='text-align: center'>";
                                _mailBody += "<a href='http://iconosquare.com/ggmotor' target='_blank'><img src='" + domainUrl + "/images/icons/instagram-big.png' width='44' height='42'></a>";
                                _mailBody += "</td>";
                                _mailBody += "<td width='43' style='text-align: center'>";
                                _mailBody += "<a href='http://www.linkedin.com/company/-com-gluaygluay-com-' target='_blank'><img src='" + domainUrl + "/images/icons/linkedin-big.png' width='44' height='42'></a>";
                                _mailBody += "</td>";
                                _mailBody += "</tr>";
                                _mailBody += "</table>";

                                _mailBody += "<table style='line-height:20px;' width='800' border='0' cellspacing='0' cellpadding='0' background='" + domainUrl + "/images/email-footer.jpg'>";
                                _mailBody += "<tr>";
                                _mailBody += "<td height='49'><br><p style='text-align: center'>© ";
                                _mailBody += DateTime.Now.ToString("yyyy",new System.Globalization.CultureInfo("en-US"));
                                _mailBody += " gluaygluay.com. All rights reserved.<br>";
                                _mailBody += "อีเมลนี้ถูกส่งจากระบบไม่ต้องการการตอบกลับ</p></td>";
                                _mailBody += "</tr>";
                                _mailBody += "</table>";
                                #endregion

                                _mailBody += "</td>";
                                _mailBody += "</tr>";
                                _mailBody += "</table>";
                                _mailBody += "</div>";
                                _mailBody += "</body>";
                                _mailBody += "</html>";
                                #endregion

                                #endregion
                                bool _emailSend = false;

                                while (!_emailSend)
                                {
                                    if (MyMailManager.SendGGMail(_smtpAccount, _smtpAuthCode, _toCusEmail, _ccwithcus, _bccwithcus, _emailCusTitle, _mailBody, _smtpReplyTo))
                                    {
                                        _mailThreeSendCount++;
                                        _emailSend = true;
                                        _bccwithcus = "";
                                    }
                                    else
                                    {
                                        _eventLog.WriteEntry(_serviceTitle + " Failed sending to " + _toemail + " at [" + MyMailManager.GetUTCDateTime().ToString() + "].", EventLogEntryType.Error);
                                        System.Threading.Thread.Sleep(_emailIntervalSec * 3000);
                                    }
                                }
                                _mailOneSendCount += 1;
                                System.Threading.Thread.Sleep(_emailIntervalSec * 1000);
                                //}
                            }
                            else
                            {
                                _noQuotationResultCount++;
                                strNoQuotationCarList.Append("<tr><td>" + _carId.ToString() + "</td><td>" + _userId.ToString() + "</td></tr>");
                                _eventLog.WriteEntry("No Email >> Customer ID :" + _userId.ToString() + ", CarID: " + _carId.ToString() + " at  [" + MyMailManager.GetUTCDateTime().ToString("dd-MMM-yyyy hh:mm tt") + "].", EventLogEntryType.Warning);
                            }

                        }
                    }




                    _eventLog.WriteEntry(_serviceTitle + " Finished at [" + MyMailManager.GetUTCDateTime().ToString("dd/MMM/yyyy hh:mm:ss tt") + "].", EventLogEntryType.Information);
                    //9/12/2556 save to tblWindowServiceLog
                    try
                    {
                        _sqlCmd = new SqlCommand();
                        _sqlCmd.Connection = _sqlConn;
                        _sqlCmd.CommandType = CommandType.StoredProcedure;
                        _sqlCmd.CommandText = "[sprocWindowServiceSaveLog]";
                        _sqlCmd.Parameters.AddWithValue("@ServiceName", "GG_Cash_Installment_Notification_Service");
                        _sqlCmd.Parameters.AddWithValue("@Subject", _serviceTitle + " was finished at " + MyMailManager.GetUTCDateTime().ToString("dd/MM/yyyy hh:mm:ss"));
                        _sqlCmd.Parameters.AddWithValue("@EmailCount", _mailThreeSendCount);
                        _sqlCmd.Parameters.AddWithValue("@ServiceStatus", 1);
                        _sqlCmd.Parameters.AddWithValue("@Status", 1);
                        _sqlConn.Open();
                        _sqlCmd.ExecuteNonQuery();
                        _sqlConn.Close();
                    }
                    catch { }

                    //_toemail = System.Configuration.ConfigurationSettings.AppSettings["ToEmail"].ToString();
                    //_ccemail = System.Configuration.ConfigurationSettings.AppSettings["CcEmail"].ToString();
                    //_bccemail = System.Configuration.ConfigurationSettings.AppSettings["BccEmail"].ToString();
                    //_emailTitle = "<Finished> " + _serviceTitle + " - " + MyMailManager.GetUTCDateTime().ToString("dd-MMM-yyyy hh:mm tt");
                    //_emailBody = new StringBuilder();
                    //_emailBody.Append("Dear All,<br/><br/>");
                    //_emailBody.Append(_serviceTitle + " was finished at " + MyMailManager.GetUTCDateTime().ToString("dd/MMM/yyyy hh:mm:ss tt") + "<br/><br/>");

                    //if (IsSendEmailCustomer == "1")
                    //{
                    //    _emailBody.Append("No. of successfully sent Cash Installment Notification mail : <b>" + _mailThreeSendCount.ToString() + "</b><br/><br/>");
                    //}
                    //else
                    //{
                    //    _emailBody.Append("Is send Email Customer : <b>" + IsSendEmailCustomer + "</b><br/><br/>");
                    //}

                    //if (_noQuotationResultCount > 0)
                    //{
                    //    strNoQuotationCarList.Append("</table><br/><br/>");
                    //    _emailBody.Append("<b>No Cash Installment Notification found list (Count:" + _noQuotationResultCount.ToString() + ")</b> <br/>");
                    //    _emailBody.Append(strNoQuotationCarList);
                    //}

                    //System.Threading.Thread.Sleep(_emailIntervalSec * 1000);

                    //while (!MyMailManager.SendGGMail(_smtpInternalAccount, _smtpInternalAuthCode, _toemail, _ccemail, _bccemail, _emailTitle, _emailBody.ToString(), _smtpReplyTo))
                    //{
                    //    _eventLog.WriteEntry(_serviceTitle + " - Failed to send FINISH MAIL to GG-Team at [" + MyMailManager.GetUTCDateTime().ToString() + "].", EventLogEntryType.Error);
                    //    System.Threading.Thread.Sleep(_emailIntervalSec * 3000);
                    //}
                    //_mailOneSendCount += 1;


                }

                #endregion
            }
            catch (Exception Ex)
            {
                _eventLog.WriteEntry(_step + ", Message:" + Ex.Message + " >> " + Ex.StackTrace.ToString(), EventLogEntryType.Error);
            }
            finally
            {
                string _mailCountStart = System.Configuration.ConfigurationManager.AppSettings["MailCountStart"].ToString();
                if (_mailOneSendCount > 0 && _mailCountStart == "1")
                {
                    MailCountLog mcl = new MailCountLog();
                    mcl.InsertMailCountLog("Cash Installment Service", _mailOneSendCount);

                }
                if (_sqlCmd != null)
                {
                    _sqlCmd = null;
                }

                if (_sqlConn.State != ConnectionState.Closed)
                {
                    _sqlConn.Close();
                    _sqlConn = null;
                }

                //this.Stop();
            }

        }

        private string GetClassNameEN(string ClassId)
        {
            switch (ClassId.Trim())
            {
                case "10":
                    return "Class 1";
                case "11":
                    return "Class 1 (Low Cost)";
                case "21":
                    return "Class 2+";
                case "31":
                    return "Class 3+";
                case "30":
                    return "Class 3";
            }

            return "";
        }

        private string GetClassNameTH(string ClassId)
        {
            switch (ClassId.Trim())
            {
                case "10":
                    return "ประกันชั้น 1";
                case "11":
                    return "ประกันชั้น 1 (ประหยัด)";
                case "21":
                    return "ประกันชั้น 2+";
                case "31":
                    return "ประกันชั้น 3+";
                case "30":
                    return "ประกันชั้น 3";
            }

            return "";
        }



        



    }
}